import React, { useRef } from 'react'
import PubSub from "pubsub-js"
import "./HeroSearch.css"
export default function HeroSearch() {
    let inp = useRef()

    let getvalue = () => {
        let value = inp.current.value

        PubSub.publish("keysearch", value)
    }
    return (
        <div className='search'>
             <h1 >英雄---列表</h1>
            <input ref={inp} type="text" placeholder='请输入你要搜素的英雄' />
            <button onClick={getvalue}>搜索</button>

        </div>
    )
}
